package com.chis.ll;

import java.io.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class ReadLl {

    public static void main(String[] args) {

        File file = new File("C:\\Users\\wlj\\Desktop\\20230421.log");
        FileReader m = null;
        FileWriter fileWriter = null;
        try {
            m = new FileReader(file);
        } catch (Exception e) {
            e.printStackTrace();
        }
        BufferedReader reader = new BufferedReader(m);
        List<String> list = new ArrayList<>();
        String guid = null;
        Date curdate = new Date();
        while (true) {
            String nextline = null;
            try {
                nextline = reader.readLine();
                if (nextline != null && nextline.length() > 8) {
                    if(nextline.contains("-") && !nextline.contains("Field")){
                        guid = nextline;

                    }
                    if(nextline.contains("Time") || nextline.contains("Field3")){

                        String tmp = nextline.substring(nextline.length()-13);
                        try {
                            if(new Date(Long.parseLong(tmp)).after(curdate)){
                                System.out.println(guid);
                            }
                        } catch (Exception e){
                            System.out.println(guid);
                        }

                    }

                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (nextline == null) break;
        }
        for(String sd : list ){
            System.out.println(sd);
        }
    }
}
